package de.lighti.starcraft.util;

import java.util.Collection;

import de.lighti.starcraft.model.StarcraftBot;
import de.lighti.starcraft.model.StarcraftMap;

public final class UtilFunctions {
    public static StarcraftBot findBotInCollection( Collection<StarcraftBot> bots, String name ) {
        for (final StarcraftBot bot : bots) {
            if (bot.getName().equals( name )) {
                return bot;
            }
        }
        return null;
    }

    public static StarcraftMap findMapInCollection( Collection<StarcraftMap> maps, String name ) {
        for (final StarcraftMap map : maps) {
            if (map.getName().equals( name )) {
                return map;
            }
        }
        return null;
    }

    private UtilFunctions() {

    }

}
